package cuiyt.designpattern.composite;
import java.util.ArrayList;
import java.util.List;
/**
 * @author cyt
 * @create 2020-07-20 12:50
 */
public class School extends OrganizationComponent {

    /**
     * 存放学院
     */
    List<OrganizationComponent> oriOrganization = new ArrayList<>();


    @Override
    public void print() {
        System.out.println("打印学校的信息");
        for (OrganizationComponent component : oriOrganization) {
            component.print();
        }
    }

    public School(String name, String des) {
        super(name, des);
    }

    @Override
    protected void add(OrganizationComponent organizationComponent) {
        oriOrganization.add(organizationComponent);
    }

    @Override
    protected void remove(OrganizationComponent organizationComponent) {
        organizationComponent.remove(organizationComponent);
    }


}
